unit uCxtDAL;

interface

uses
  uDZSysUtils, uDZPersistent, uGxtSvcIntf, uCxtTypes, uCxtUser;

const
  IID_ACCOUNT_DATABASE: TGUID = '{76F0E104-4954-439B-AC97-993636080E8A}';
  IID_VEHICLE_DATABASE: TGUID = '{5F75D05A-77AD-4C22-AD82-B3ADF8763593}';
  
type
  IAccountDatabase = interface(IDzBaseInterface)
  ['{76F0E104-4954-439B-AC97-993636080E8A}']
    function GetAgencyInfo(city: Integer; agency: TAgency;
      var Error: TErrorInfo): Boolean;
    function AddAccount(ui: TUserInfo; var Error: TErrorInfo): Boolean;
    function ModifyAccount(ui: TUserInfo; var Error: TErrorInfo): Boolean;
    function ModifyPassword(uid: Integer; const oldpwd, newpwd: string;
      var Error: TErrorInfo): Boolean;
    function LockUserByID(UserID: Integer; const CID: AnsiString;
      const Reason: WideString; var Error: TErrorInfo): Boolean;
    function GetUserInfo(const userName: string; ui: TUserInfo;
      var Error: TErrorInfo): Boolean;
    function GetUserLocatePoint(userId: Integer; var point: Integer;
      var Error: TErrorInfo): Boolean;
    function DecUserLocatePoint(id, value: Integer;
      var Error: TErrorInfo): Boolean;
    function GetUserSmsPoint(userId: Integer; var point: Integer;
      var Error: TErrorInfo): Boolean;
    function DecUserSmsPoint(userId, value: Integer;
      var Error: TErrorInfo): Boolean;
    function SaveLogin(UserID: Integer; LoginTime: TDateTime;
      const tunnel, ComputerID: AnsiString; var Error: TErrorInfo): Boolean;
    function SaveSms(const sender, recver, content: WideString;
      timetick: TDateTime; var Error: TErrorInfo): Boolean;
    function ModifyComputerID(UserID: Integer; const HID: AnsiString;
      var Error: TErrorInfo): Boolean;
    function LockComputer(const ComputerID: AnsiString;
      const Reason: WideString; var Error: TErrorInfo): Boolean;
    function UnlockCompter(const ComputerID: AnsiString;
      var Error: TErrorInfo): Boolean;
    function IsComputerLocked(const CID: AnsiString;
      var Reason: WideString; var Error: TErrorInfo): Boolean;
  end;

  IVehicleDatabase = interface(IDzBaseInterface)
  ['{5F75D05A-77AD-4C22-AD82-B3ADF8763593}']
    function GetPriVehicle(userId, pageSize, pageNo: Integer;
      filter: TPriVehicleFilter; list: TDzPersistentList;
      out totalRecord: Integer; var Error: TErrorInfo): Boolean;
    function GetShareVehicle(_type: TLBSObjectType;
      filter: TShareVehicleFilter; pageNo, pageSize: Integer;
      list: TDzPersistentList; out total: Integer; var Error: TErrorInfo): Boolean;
    function RemovePriVehicle(vlist: TDzPersistentList;
      var removed: Integer; var Error: TErrorInfo): Boolean;
    function AddPriVehicle(vehicle: TVehicle; var Error: TErrorInfo): Boolean;
    function ModifyPriVehicle(vehicle: TVehicle;
      var Error: TErrorInfo): Boolean;
    function RemoveLocPerson(persons: TDzPersistentList;
      var removed: Integer; var Error: TErrorInfo): Boolean;
    function AddLocPerson(persons: TDzPersistentList;
      out added: Integer; var Error: TErrorInfo): Boolean;
    function ModifyLocPerson(persons: TDzPersistentList;
      out numDone: Integer; var Error: TErrorInfo): Boolean;
    function GetLocPerson(userID, pageNo, pageSize: Integer;
      filter: TLocPersonFilter; list: TDzPersistentList;
      out total: Integer; var Error: TErrorInfo): Boolean;
    function SaveLocateResult(const lng, lat, addr, cityName: WideString;
      const Phone: AnsiString; cityCode, userID, carID, consume: Integer;
      method: TLbmpLocType; var Error: TErrorInfo): Boolean;
    function SetAutoLocTime(userID, hour: Integer;
      var Error: TErrorInfo): Boolean;
    function GetLocTrace(ltid: Integer; tracing: TVehicleTracing;
      var Error: TErrorInfo): Boolean;
    function AddLocTrace(tracing: TVehicleTracing;
      var Error: TErrorInfo): Boolean;
    function RemoveLocTrace(ltid: Integer;
      var Error: TErrorInfo): Boolean;
    function ModifyLocTrace(tracing: TVehicleTracing;
      var Error: TErrorInfo): Boolean;
    function ModifyLBMPState(const phone: AnsiString; status: Integer;
      var Error: TErrorInfo): Boolean;
  end;

implementation

end.
